﻿using NUnit.Framework;
using System.Threading.Tasks;
using TabbedTemplate.Services;

namespace UnitTest.Services
{
    public class TestTextAnalysisService
    {
        [Test]
        public async Task TestAnalysisEmotionAsync()
        {
            ITextAnalysisService textAnalysisService =
                new TextAnalysisService();
            var res0 = await textAnalysisService.AnalysisEmotionAsync("今天心情真不错！");
            var res00 = await textAnalysisService.AnalysisEmotionAsync("I am in a good mood today!");
            var res1 = await textAnalysisService.AnalysisEmotionAsync("好想去吃好吃的，可是还没考完试。");
            var res11 = await textAnalysisService.AnalysisEmotionAsync("I really want to eat delicious food, but I haven't finished the exam yet.");
            var res2 = await textAnalysisService.AnalysisEmotionAsync("麦当劳的新品真的太好吃了，肉柔软多汁，我很喜欢，但是熙熙觉得太辣了...");
            var res22 = await textAnalysisService.AnalysisEmotionAsync("The new product of McDonald's is really delicious. The meat is soft and juicy. I like it very much, but Xixi thinks it is too spicy ...");
            var res3 = await textAnalysisService.AnalysisEmotionAsync("今天下雨了，所以在楼下新开的小吃店买了一份小笼包，形状是小熊猫，非常可爱！");
            var res33 = await textAnalysisService.AnalysisEmotionAsync("It rained today, so I bought a small steamed bun in the newly opened snack bar downstairs. The shape is red panda, which is very cute!");
        }
        [Test]
        public void TestConverter()
        {
            TextAnalysisService textAnalysisService = new TextAnalysisService();
            var res = textAnalysisService.ConvertHtmlToText("<p>nihao</p>");
            Assert.AreEqual("nihao", res);
        }

        [Test]
        public async Task TestTranslate()
        {
            TextAnalysisService textAnalysisService = new TextAnalysisService();
            var res = await textAnalysisService.TranslateToENAsync("好想去吃好吃的，可是还没考完试。");


        }
    }
}
